package com.bjsxt.chapter13_iterator;

/**
 * @ClassName Client
 * @Description 客户端类
 * @Author 黑马程序员
 * @Date 15:01 2024/6/23
 * @Version 1.0
 **/
public class Client {
    public static void main(String[] args) {
        ConcreteMyAggregate cma = new ConcreteMyAggregate();
        cma.addObject("aa");
        cma.addObject("bb");
        cma.addObject("cc");

        MyIterator iter = cma.createIterator();
        while (iter.hasNext()){
            System.out.println(iter.getCurrentObj());
            iter.next();
        }
    }
}
